// 工具函数
import React from "react";
// 成功提示信息
const success = (message: string, afterClose?: Function, duration?: number): void => {
  React.UI.Toast.show({
    icon: 'success',
    content: message,
    afterClose,
    duration: duration ? duration : 2000
  })
}

// 失败提示信息
const fail = (message: string, afterClose?: Function, duration?: number): void => {
  React.UI.Toast.show({
    icon: 'fail',
    content: message,
    afterClose,
    duration: duration ? duration : 2000
  })
}

export {
  success,
  fail
}